﻿CREATE PROCEDURE [ServiceEngine].[ListOperationsByResource]
@ResourceID UNIQUEIDENTIFIER
AS
BEGIN
	SET NOCOUNT ON;

	SELECT	
			N.[EntityID] as ID, 
			N.[EntityName] as [Name], 
			N.EntityDescription as Description
	FROM	[ServiceEngine].Names N
	JOIN	[ServiceEngine].OperationVersions OV on N.[EntityID] = OV.OperationID
	JOIN	[ServiceEngine].Operations O on O.OperationID = OV.OperationID
	JOIN	[ServiceEngine].Resources R on OV.ResourceID = R.ResourceID
	WHERE	N.[EntityTypeID] = 4
	AND		R.ResourceID = @ResourceID 
END

